<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>菜鸟教程</title>
  </head>
  <body>
    <script type="text/javascript">
      function getRandom(min, max) {
        return Math.floor(Math.random() * (max - min + 1)) + min;
      }

      const array = ["张三", "李四", "王五", "马六"];
      const index = getRandom(0, array.length - 1);
      console.log(array[index]);

      var url = "http://www.cnblogs.com/smyhvae/";
      var str = encodeURIComponent(url);
      console.log(str);
      console.log(decodeURIComponent(url));
    </script>
  </body>
</html>
